<!DOCTYPE html>
<html>
<head>
    <include file="Public/head"/>
</head>
<body>

<div class="ui-wrap">

    <!--s banner-1-->
    <div class="swiper-container swiper-container-1">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
                <img src="__IMG__/Home/bm-1.jpg"/>
            </div>
            <div class="swiper-slide">
                <img src="__IMG__/Home/bm-2.jpg"/>
            </div>
            <!--<div class="swiper-slide">-->
            <!--<img src="http://placeholder.qiniudn.com/640x260"/>-->
            <!--</div>-->
            <!--<div class="swiper-slide">-->
            <!--<img src="http://placeholder.qiniudn.com/640x260"/>-->
            <!--</div>-->
        </div>
        <div class="swiper-pagination swiper-pagination-1"></div>
    </div><!--e banner-1-->

    <form action="{:U('Lord/apply_ok')}" method="post" enctype="multipart/form-data" id="myform" onsubmit ="getElementById('submitInput').disabled=true;return true;" >
    <div class="ui-from">
        <div class="ui-from-title">
            <span>群主资料</span>
        </div>
        <lable class='ui-from-itme'>
            <span>群名称</span>
            <input type="text" name="lord_name" class="text_ipt" id="lord_name" value="{$info.lord_name}" placeholder="群名称" />
        </lable>
        <lable class='ui-from-itme'>
            <span>群主姓名</span>
            <input type="text" name="user_name" class="text_ipt" id="user_name" value="{$info.user_name}" placeholder="群主姓名/群主昵称" />
        </lable>
        <lable class='ui-from-itme'>
            <span>手机号</span>
            <input type="tel"  name="user_phone" class="text_ipt" id="user_phone" value="{$info.user_phone}" placeholder="您的手机号" maxlength="11" />
        </lable>
        <lable class='ui-from-itme'>
            <span>验证码</span>
            <input type="tel" name="code" id="code" value="" placeholder="您收到的验证码" />
            <input type="hidden" name="recode" id="recode">
            <a href="javascript::" class="get-btn">获取验证码</a>
        </lable>
        <lable class='ui-from-itme'>
            <span>靓照</span>
            <input type="text" class="text_ipt" readonly="readonly" placeholder="请点击下方的“+”号按钮上传靓照" />
        </lable>
        <div class="ui-ImgFile">
            <input type="file" class="text_ipt" id="choose" name="choose" accept="image/*" multiple>
            <a id="upload">+</a>
            <ul class="img-list">
				<li style="background-image: url(Uploads/{$info.lord_img|get_cover='path'});"></li>
            </ul>

            <div class="ui-fileImg-remark">
                <p>注：只允许上传一张jpg、png及gif</p>
            </div>
        </div>
        <div class="ui-from-title">
            <span>群资料</span>
        </div>
        <lable class='ui-from-itme'>
            <span>群描述</span>
            <input type="text" class="text_ipt" name="content" id="content" value="{$info.content}" placeholder="有逼格的群，都有底蕴" />
        </lable>
        <lable class='ui-from-itme'>
            <span>拉票宣言</span>
            <input type="text" class="text_ipt" name="lord_manifesto" id="lord_manifesto" value="{$info.lord_manifesto}" placeholder="拉票，总得说点什么" />
        </lable>
    </div>
	<input type="hidden" id="img_url" value="0">
    <input type="hidden" id="lord_id" name="lord_id" value="{$info.lord_id}">
    <a class="ui-from-submit visibility">占位</a>
    <a onclick="nextStep();" id="submitInput" class="ui-from-submit show">提交资料</a>
    </form>
</div>
<input type="hidden" id="user" value="{$user.lord_id}">
<script src="__JS__/lib/swiper/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__JS__/lib/jQuery/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="__JS__/lib/IMG_file/imgFile.js" type="text/javascript" charset="utf-8"></script>
<script language="javascript">
    var mySwiper = new Swiper('.swiper-container',{pagination : '.swiper-pagination'});
    $(function(){
        var seed = 60;
        var t;
        var ts = $('.get-btn');
        var bol = true;
        $('.get-btn').click(function(){
            //alert(123);
            if(bol){
                var phone = $('#user_phone').val();
                $.ajax({
                    url:"{:U('Index/ajaxCode')}",
                    type:'post',
                    data:{phone:phone},
                    success:function(result){
                        if(result.status==1){
                            fun();
                            $('#recode').val(result.msg);
                        }else{
                            alert("服务器异常,请联系管理员");
                        }
                    }
                });
            }
        })
        var fun = function(){
            bol = false;
            if(seed>0){
                seed--;
                ts[0].innerHTML = seed+'秒后获取';
                t = setTimeout(fun,1000);
            }else{
                seed = 60;
                bol = true;
                ts[0].innerHTML = '获取验证码';
                clearTimeout(t);
            }
        }
    })

</script>
<script type="text/javascript">
    function nextStep(){
        $("form :input.text_ipt").trigger('blur');
        var numError = $('form .onError').length;
        if(numError){
            return false;
        }
        if($('#lord_name').val()==""){
            alert('群名称不能为空');
            return false;
        }
        if($('#user_name').val()==""){
            alert('群主姓名不能为空');
            return false;
        }
        if($('#user_phone').val()==""){
            alert('联系电话不能为空');
            return false;
        }
        if($('#lord_manifesto').val()==""){
            alert('拉票宣言不能为空')
            return false;
        }
        if($('#content').val()==""){
            alert('群描述不能为空')
            return false;
        }
        if($('#choose').val()==""){
            alert('请上传图片');
            return false;
        }
/*        if($('#img_url').val()== 1){
            alert('上传图片能大于500KB');
            return false;
        }*/
        if($('#code').val()==""){
            alert('请填写验证码');
            return false;
        }
        if($('#code').val() != $('#recode').val()){
            alert('验证码错误');
            return false;
        }
        if($('#user').val() != "" && $('#lord_id').val() == "") {
            alert('您已经报过名，不能重复报名');
            return false;
        }
        $('#myform').submit();
    }
    function hideaddr(){
        $('#car-more-main').hide();
        $("#car-more-btn").removeClass('on');
    }

</script>
<script language="javascript">
    var mySwiper = new Swiper('.swiper-container',{pagination : '.swiper-pagination',autoplay : 3000})
</script>
</body>
</html>

